Emscripten
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
top
Emscripten is an LLVM/Clang-based compiler that compiles C and C++ source code to WebAssembly,cite-ref-4[4] primarily for execution in web browsers.
Emscripten allows applications and libraries written in C or C++ to be compiled ahead of time and run efficiently in web browsers, typically at speeds comparable to or faster than interpreted or dynamically compiled JavaScript. It even emulates an entire POSIX operating system, enabling programmers to use functions from the C standard library (libc).cite-ref-clarkl-2019-5-0[5]
Contents
• Usage
• Creation
• See also
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Usage
Emscripten has been used to port a number of C/C++ code bases to WebAssembly, including Unreal Engine 3, SQLite,cite-ref-9[9] MeshLab,cite-ref-10[10] Bullet physics,cite-ref-11[11] AutoCAD,cite-ref-12[12] and a subset of the Qt application framework.cite-ref-0-13-0[13] Other examples of software ported to WebAssembly via Emscripten include the following:
Game engines
The Unity, Defold, and Godot game engines provide an export option to HTML5, utilizing Emscripten.cite-ref-14[14]cite-ref-15[15]cite-ref-16[16] Unreal Engine had this export option but it has been migrated out of the engine to a community member plug in.cite-ref-17[17] The Source Engine, has a community developed port for Emscripten dubbed "HalfLife2JS"cite-ref-18[18]
Frameworks & toolkits
openFrameworks exports native C++ applications to HTML5 via Emscripten.cite-ref-19[19] emscripten-qt permits compiling applications written using the Qt application framework to WebAssembly.cite-ref-0-13-1[13]
Software archiving
Creation
Emscripten was created by Alon Zakai in 2010, motivated by his desire to port his fork of the open source first-person shooter game Sauerbraten, known as Syntensitycite-ref-23[23], to the web. Sauerbraten (also known as Cube 2) is an open source FPS gamecite-ref-24[24], and Syntensity was Zakai’s project that extended the Cube 2 Engine for greater flexibility. Observing the increasing shift of applications to web browsers, Zakai began developing Emscripten as an LLVM-to-JavaScript compiler, aiming to make it possible to run existing C and C++ code, such as game engines, directly in the browser. In early blog posts, Zakai explained that his long-term goal was “to run Syntensity, or a smaller version of it, on the web”cite-ref-25[25], and Emscripten was released as open source shortly after its initial development, making it available for the broader community to experiment with and contribute to.cite-ref-26[26]cite-ref-27[27]
See also
References
cite-note-11. citerefzakai-alon2011Zakai,Alon (22 October 2011). "Emscripten: An LLVM-to-JavaScript compiler". Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion. OOPSLA. pp. 301–312. doi:10.1145/2048147.2048224. ISBN 978-1-4503-0942-4.
cite-note-wikidata-d8029f6d81e1502762f9785fa81cbda18b8aee44-v20-22. "Release 4.0.11". 11 July 2025. Retrieved 17 July 2025.
cite-note-33. "emscripten-core/emscripten: Emscripten: An LLVM-to-JavaScript Compiler". GitHub. C: 40.0%; C++: 34.4%; JavaScript: 17.4%.
cite-note-44. ↑ WebAssembly · emscripten-core/emscripten Wiki · GitHub
cite-note-clarkl-2019-55. ↑ citerefclarkClark, Lin. "Standardizing WASI: A system interface to run WebAssembly outside the web – Mozilla Hacks - the Web developer blog". Mozilla Hacks – the Web developer blog. Mozilla. Retrieved 31 October 2022.
cite-note-66. ↑ citerefthe-wasmtime-projectThe Wasmtime Project. "WASI: The WebAssembly System Interface". WASI.dev. The Wasmtime Project. Retrieved 2021-02-10.
cite-note-77. ↑ citerefthe-wasmtime-projectThe Wasmtime Project. "Wasmtime: A small and efficient runtime for WebAssembly & WASI". Wasmtime.dev. The Wasmtime Project. Retrieved 2021-02-10.
cite-note-88. ↑ citerefwasmerWasmer. "Wasmer: The Universal WebAssembly Runtime". Wasmer.io. Wasmer. Retrieved 2021-02-10.
cite-note-99. ↑ "sqlite3 WebAssembly & JavaScript Documentation Index". SQLite. Retrieved 2023-05-08.
cite-note-1111. ↑ "Porting Examples and Demos". Emscripten GitHub wiki. Retrieved 2016-03-01.
cite-note-1212. ↑ "The Future of AutoCAD". Through the Interface. Retrieved 2018-05-09..
cite-note-0-1313. ↑ "Qt for WebAssembly".
cite-note-1414. ↑ "Unity game engine heading to the browser without plug-ins". Ars Technica. 18 March 2014. Retrieved 2016-03-01.
cite-note-1515. ↑ "The future of scripting in Unity – Unity Blog". Unity Technologies Blog. Retrieved 2016-03-01.
cite-note-1616. ↑ "Defold HTML Development". Defold Documentation. Retrieved 2023-12-18.
cite-note-1717. ↑ "Developing HTML5 with Unreal". Unreal Documentation. 18 December 2023. Retrieved 2018-12-18.
cite-note-1818. ↑ Half-Life 2: Javascript, EmSource, 2025-04-13, retrieved 2025-04-14
cite-note-1919. ↑ "openFrameworks setup for Emscripten". openFrameworks. Retrieved 2016-03-04.
cite-note-2020. ↑ citerefohlheiser2015Ohlheiser, Abby (2015-01-05). "You can now play nearly 2,400 MS-DOS video games in your browser". The Washington Post. Retrieved 2015-01-08.
cite-note-2121. ↑ Each New Boot a Miracle by Jason Scott (December 23, 2014)
cite-note-2222. ↑ "Internet Archive Search: "collection:softwarelibrary_msdos"". archive.org. Retrieved 2016-03-01.
cite-note-2323. ↑ citerefkripken2009Kripken (2009-04-22). "Scriptensity: Intro". Scriptensity. Retrieved 2025-07-24.
cite-note-2424. ↑ "Cube 2: Sauerbraten". sauerbraten.org. Retrieved 2025-07-24.
cite-note-2525. ↑ citerefkripken2010Kripken (2010-08-29). "Scriptensity: Emscripten". Scriptensity. Retrieved 2025-07-24.
cite-note-2626. ↑ citerefkripken2010Kripken (2010-08-14). "Scriptensity: Update on Where Things are Going". Scriptensity. Retrieved 2025-07-24.
cite-note-2727. ↑ "Make your own games with Syntensity". www.dedoimedo.com. Retrieved 2025-07-24.
External links
• Official website
• Project page on GitHub
• Emscripten Documentation
• Porting Examples and Demos
• A list of some WebAssembly runtimes